home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Passing C++ member functions to Xview notifier functions.
- Date: 7 Jan 1996 22:56:09 GMT
- Organization: self-employed
- Message-ID: <4cpj29$hlc@news.bridge.net>
- References: <4chhsn$sim@msunews.cl.msu.edu>
- NNTP-Posting-Host: ppp-mia1-39.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- Robert;
-
- C++ member functions take one 'invisible' parameter, i.e.
- the address of an object,which becomes 'this'. Thus,
- their addresses are not compatible with ordinary
- function pointers.
-
- A completely general approach to this problem was
- discussed in the C++ Report, February 95. It involved
- a set of template classes. Objects of these classes store
- both a function and an object address; these objects are
- passed around and used as callbacks. Class information from
- one program module never leak sinto another, as long as they
- both designed from the start to use these callback classes
- instead of function addresses.
-
- For an immediate solution to your problem, you can see Phil
- Staite's post.
-
- David
-
-
-